
.group-chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20rpx 30rpx;
  height: 120rpx;
  background-color: #ffffff;
  border-bottom: 1rpx solid #f5f5f5;
  margin-bottom: 20rpx;
}

.user-info {
  display: flex;
  align-items: center;
  position: relative;
  left: 170rpx;
  top: 50rpx;
}

.user-text {
  display: flex;
  flex-direction: column;
}

.title {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
}

.chat-messages {
  flex: 1;
  padding: 20rpx;
  overflow-y: auto;
  background-color: #f5f5f5; /* 背景色改为与单聊一致 */
}

// 系统消息样式
.system-message {
  display: flex;
  justify-content: center;
  margin: 15rpx 0;
}

.system-message-text {
  font-size: 24rpx;
  color: #888;
  background-color: #e5e5e5;
  padding: 8rpx 16rpx;
  border-radius: 16rpx;
}

// 消息项样式
.message-item {
  display: flex;
  align-items: flex-start; // 添加此属性确保头像和消息在顶部对齐
  margin-bottom: 25rpx;
  max-width: 100%;
  animation: fadeIn 0.3s ease-out forwards;
}

// 调整头像样式，确保与消息对齐
.avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  margin: 0 20rpx;
  object-fit: cover;
  flex-shrink: 0; // 添加此属性确保头像不会被压缩
  margin-top: 6rpx; // 微调头像位置，使其与消息气泡对齐
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10rpx); }
  to { opacity: 1; transform: translateY(0); }
}

// 对方消息样式
.other-message {
  justify-content: flex-start;
}

.other-message .avatar {
  border: 2rpx solid #e5e5e5;
}

.other-message .message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.other-message .message-bubble {
  background-color: #ffffff; /* 对方消息背景色 */
  color: #333; /* 对方消息文字颜色 */
  border-radius: 20rpx; /* 圆角 */
  border-top-left-radius: 0; /* 左上角无圆角 */
  padding: 20rpx 25rpx;
  max-width: 75%;
  position: relative;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}

// 对方消息三角形
.other-message .message-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: -16rpx;
  border-top: 16rpx solid #ffffff;
  border-right: 16rpx solid transparent;
}

// 我方消息样式 - 修正头像位置
.my-message {
  justify-content: flex-end;
  /* 移除 flex-direction: row-reverse; 以确保头像在消息右边 */
}

.my-message .avatar {
  border: 2rpx solid #3B82F6;
  /* 确保头像在消息右边 */
  order: 2;
}

.my-message .message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  order: 1;
}

.my-message .message-bubble {
  background-color: #3B82F6; /* 我方消息背景色 */
  color: #ffffff; /* 我方消息文字颜色 */
  border-radius: 20rpx; /* 圆角 */
  border-top-right-radius: 0; /* 右上角无圆角 */
  padding: 20rpx 25rpx;
  max-width: 75%;
  position: relative;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}

// 我方消息三角形
.my-message .message-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  right: -16rpx;
  border-top: 16rpx solid #3B82F6;
  border-left: 16rpx solid transparent;
}

// 时间戳样式
.message-time {
  font-size: 24rpx;
  color: #888;
  margin: 6rpx 0;
}

// 输入区域样式
.input-area {
  display: flex;
  align-items: center;
  padding: 20rpx;
  background-color: #ffffff;
  border-top: 1rpx solid #f5f5f5;
}

.emoji-btn {
  width: 60rpx;
  height: 60rpx;
  margin-right: 20rpx;
}

.message-input {
  flex: 1;
  height: 70rpx;
  padding: 0 20rpx;
  background-color: #f5f5f5;
  border-radius: 35rpx;
  font-size: 30rpx;
}

.send-btn {
  width: 120rpx;
  height: 70rpx;
  margin-left: 20rpx;
  background-color: #3B82F6;
  color: #ffffff;
  border-radius: 35rpx;
  font-size: 30rpx;
  line-height: 70rpx;
  text-align: center;
  border: none;
}